<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class ProjectMonitorTeam extends Model
{
    use HasFactory;

    protected $connection = 'bpm';
    protected $table='project_monitor_team';

    //获取团队信息
    public static function lists(){
        $where=[];

        $query=self::where($where);
        $count=$query->count();
        $data = $query->orderBy('monitor_team_uid', 'desc')->get()->map(function (ProjectMonitorTeam $rebate) use ($count) {
            $rebate = $rebate->attributesToArray();
            return $rebate;
        })->toArray();
        return $data ? compact('count', 'data') : false;

    }
}
